package org.fig.ioc.bean.definition;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;


/**
 * @Description: 垃圾回收
 * @Author: Flynn Vanderboom
 * @Data: 2021/6/16 10:03
 */
@Configuration
public class BeanGarbageCollectionDemo {
    public static void main(String[] args) {
        //创建BeanFactory容器
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
        applicationContext.register(BeanInitializationDemo.class);
        //启动Spring应用上下文
        applicationContext.refresh();
        applicationContext.close();
        //强制触发GC
        System.gc();

    }

}
